/* eslint-disable */
// @ts-ignore
import request from '@/utils/request';
import { CustomRequestOptions } from '@/interceptors/request';

import * as API from './types';

/** 分页查询核心指标 GET /core_target */
export async function coreTargetGetCoreTargetPage({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.CoreTargetGetCoreTargetPageParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelResponseDataListModelCoreTargetModel_>(
    '/core_target',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 编辑核心指标 PUT /core_target */
export async function coreTargetEditCoreTarget({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.CoreTargetEditCoreTargetParams;
  body: API.UpsertCoreTargetModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/core_target', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增核心指标 POST /core_target */
export async function coreTargetAddCoreTarget({
  body,
  options,
}: {
  body: API.UpsertCoreTargetModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/core_target', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除核心指标 DELETE /core_target */
export async function coreTargetDeleteCoreTarget({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.CoreTargetDeleteCoreTargetParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/core_target', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 查询核心指标列表 GET /core_target/list */
export async function coreTargetGetCoreTargetList({
  options,
}: {
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelListString_>('/core_target/list', {
    method: 'GET',
    ...(options || {}),
  });
}
